<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Admin\Store;
use App\Models\Admin\Grade;


class GradeController extends Controller
{
    // 初始化 等级信息
    public function iniGrade(Request $request)
    {
        //获取等级信息 => 店铺ID / 店铺信息 / 店铺等级信息 验证
        $Grade = new Grade;
        $get_grade = $Grade->analyGrade($request['id'] ? $request['id'] : 0);
        return $get_grade;
    }

    // 提交等级信息
    public function gradeSubmit(Request $request)
    {
        // 验证字段合法性 => 提交数据
        // return $request['data'];
        $Grade = new Grade;
        $insert_grade = $Grade->insertAnlayArr($request['id'], $request['data']);
        return $insert_grade;
    }
}
